import Vue from 'vue'
import './business'
import './tool'

import '@/router/permission' // permission control
// 全局组件自动注册
import '@/components/autoRegister'
// 事件
import {eventBus} from '@/utils/eventBus'

import directive from './directive' // directive
import VueClipboard from 'vue-clipboard2'

Vue.use(VueClipboard)

Vue.use(directive)

Vue.prototype.bus = eventBus

Vue.prototype.msgSuccess = function (msg) {
  this.$message({showClose: true, message: msg, type: 'success'})
}
Vue.prototype.msgError = function (msg) {
  this.$message({showClose: true, message: msg, type: 'error'})
}
Vue.prototype.msgWarning = function (msg) {
  this.$message({showClose: true, message: msg, type: 'warning'})
}
Vue.prototype.msgInfo = function (msg) {
  this.$message.info(msg)
}

